package main

import (
	"fmt"
	"reflect"
)

func main() {
	type T struct {
		A int
		B string
	}
	t := &T{23, "skidoo"}
	//s := reflect.ValueOf(&t).Elem()
	s := reflect.ValueOf(t).Elem()
	typeOfT := s.Type()
	for i := 0; i < s.NumField(); i++ {
		f := s.Field(i)
		fmt.Printf("%d: %s %s = %v\n", i, typeOfT.Field(i).Name, f.Type(), f.Interface())
	}

	type xx struct {
		mp map[uint32]uint32
		ok bool
	}
	var mp map[uint32]uint32
	x := new(xx)
	fmt.Printf("xx :%v", x)
	return
	if _, exist := x.mp[3]; !exist {
		fmt.Printf("x.mp[3] no exist")
		return
	}
	fmt.Printf("value:%v  v:%d\n", x.mp, x.mp[1])
	mp = make(map[uint32]uint32, 20)
	mp[2] = 2222
	mp[3] = 3333
	fmt.Printf("mp len:%d value:%v\n", len(mp), mp)
}
